package com.linwen.javase.desgin_pattern.create.clone;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName Teacher
 * @Description
 * @Author lin
 * @Date 2022/6/15 上午12:38
 * @Version V1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Teacher implements Cloneable {
    private String name;
    private int age;
    private Student student;
    @Override
    public Teacher clone() throws CloneNotSupportedException {
        Teacher clone = (Teacher) super.clone();
        clone.setStudent(this.student.clone());
        return clone;
    }
}
